{template admin/header}

<div class="mt10">
<style type="text/css">
    .radio_uid{margin: 10px;}
    .tableborder td{padding: 0px;}
</style>
    <form action="{$action}" method="post" enctype="multipart/form-data" name="form1" id="form1">
        <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
            <tr class="header">
                <td colspan="2">{$title}</td>
            </tr>
            <tr>
                <td width="13%" bgcolor="#F8F8F8">&nbsp;</td>
                <td width="87%" bgcolor="#FFFFFF">&nbsp;</td>
            </tr>
            <tr>
                <td width="13%" bgcolor="#F8F8F8">搜索用户</td>
                <td bgcolor="#FFFFFF">
                    <input id="username" type="text" value="" name="username">
                    <input id="check_PublishBox_uid" type="hidden" value="" name="check_PublishBox_uid">
                    <input type="submit" class="adminTopsearchbutton" name="usernamesubmit" value="搜索">
                </td>
            </tr>
            <tr>
                <td width="13%" align="center" bgcolor="#F8F8F8">发表用户：</td>
                <td bgcolor="#FFFFFF" id="users">
                    
                </td>
            </tr>
            <tr>
                <td width="13%" align="center" bgcolor="#F8F8F8">微博内容:</td>
                <td bgcolor="#FFFFFF">
                    {template admin/topic_publish}  
                </td>
            </tr>
        </table>

    </form>

</div>
<script type="text/javascript">
    $(function() {
        $("input[name=usernamesubmit]").click(function() {
            var username = $("input[name=username]").val();
            $.post("ajax.php?mod=member&code=select_nickname", {
                nickname: username
                },
                function(ret) {
                    var json = $.parseJSON(ret);
                    if(json && json.done){
                        var list = json.retval;
                        var html = '';
                        for (var i = 0, len = list.length; i < len; i++) {
                            var data = list[i];
                            html += '<input type="radio" class="radio_uid" name= "radio_uid" value="'+data.uid+'" />'+data.nickname;
                        }
                        $("#users").html(html);
                        radio_check();
                    }
                }
            );
            return false;
        });
        function radio_check(){
            $("#users").find("input[name=radio_uid]").click(function(){
                var uid = $(this).val();
                $("#check_PublishBox_uid").val(uid);
                
            });
        }
        
    })
</script>
